import CourseData from '@/data/course';
import { filterData } from '@/libs/utils'

export default async (store, type, param) => {

  switch (type) {
      case 'getData':
          store.commit('setCourseData', CourseData);
          break;
      case 'setCourseSelectType':
          store.commit('setCourseSelectType', param);
          break;
      case 'login':
          store.commit('setUserData', param);
          break;
      case 'getSearchData':
          store.commit('setCourseData', CourseData);
          const data = filterData(store.state.courseData, param)
          store.commit('setCourseData', data);
          break;
      case 'changTabIndex':
          store.commit('setTabIndex', param);
          break;
  }

}